<template>
  <div class='rate text-primary'>
    <span class="star">☆☆☆☆☆</span>
    <div class="hollow star" :style='style'>★★★★★</div>
  </div>
</template>
<script>
// vue-tiny-rate
export default {
  props: {
    value: {type: [Number, String], default: '0'}
  },
  computed: {
    style () {
      return `width: ${this.value * 10}%;`
    }
  }
}
</script>
<style lang='scss'>
.rate{
  position: relative;
  display: inline-block;
  .star {
    letter-spacing: 0;
  }
  .hollow{
    position: absolute;
    top:0;
    left:0;
    bottom: 0;
    width:0;
    overflow:hidden;
  }
}
</style>